<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
class DmdaotaoViewCongtacnn extends JViewLegacy {
	protected $items;
	protected $state;
	protected $pagination;
	function display($tpl = null) {
	  $task = JRequest::getVar('task');
		  switch($task){
		   case 'add':
		   case 'edit':
		    $this->getEditItem();
		    $this->setLayout('form');
		    break;
		   default :
		    $this->_default();
		    break;
  }
  parent::display($tpl);
 }
 public function _default(){
 	$document = JFactory::getDocument();
 	$document->addScript(JUri::base(true).'/components/com_dmdaotao/js/jquery-1.11.1.js');
 	$document->addScript(JUri::base(true).'/components/com_dmdaotao/js/bootstrap.min.js');
 	$document->addScript(JUri::base(true).'/components/com_dmdaotao/css/bootstrap.css');
 	$model = JModelLegacy::getInstance('Congtacnn','DmdaotaoModel');
 	
 	$items  = $model->findAll();
 	$this->assignRef('items', $items);
 	$title=JRequest::getVar('title');
 	$this->assignRef('title', $title);
 }
 function getEditItem(){
 	$vName = JRequest::getString('view');
 	$row =JRequest::getVar('data');
 	$this->assignRef('row', $row);
 }
}

?>